package com.tv189.springbatchtest.listener;

import org.springframework.batch.core.JobExecution;
import org.springframework.batch.core.annotation.AfterJob;
import org.springframework.batch.core.annotation.BeforeJob;

/**
 * @ClassName: JobSateAnnoListener
 * @Description: 作业状态监听器
 * @Author: 19202
 * @Date: 2025/5/19 23:03
 * @Version 1.0
 **/
public class JobSateAnnoListener {

    /**
     * 之前工作
     *
     * @param jobExecution 作业执行
     */
    @BeforeJob
    public void beforeJob(JobExecution jobExecution) {
        System.out.println("执行前-status:" + jobExecution.getStatus());
    }

    /**
     * 后工作
     *
     * @param jobExecution 作业执行
     */
    @AfterJob
    public void afterJob(JobExecution jobExecution) {
        System.out.println("执行后-status:" + jobExecution.getStatus());
    }
}
